<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp"%>
<%@ include file="/commons/tabs.jsp"%>

<html>
<head>
<title>业户回访  主页面</title>
<link href="${ctx}/css/grid.css" rel="stylesheet" type="text/css" />
<link href="${ctx}/styles/listTable.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<script type="text/javascript" src="${ctx}/scripts/public.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common/prototype.js"></script>
<script type="text/javascript" src="${ctx}/scripts/common.js"></script>
</head>
<script type="text/javascript">
	var ACTION_URL = "${ctx}/customerService_ownersVisitAction.do?";
	var ownersWisitId = "";
	var cur_p = 1;

	function openAdd(){
		var url = ACTION_URL + "method=addPage" ;
		top.windowOpen(url, "editPage", "新增" , 380, 500,true,"editPageIfm");
	}

	function openEdit(){

		if(ownersWisitId == ""){
				Alert("请选择一条记录！");
				return ;
		}

		var url = ACTION_URL+"method=editPage&keyword="+ownersWisitId;
		top.windowOpen(url, "editPage", "修改", 380, 500,true,"editPageIfm");
	}

	function detail(keyword){
		var url = ACTION_URL+"method=detailPage&keyword="+keyword;
		top.windowOpen(url, "detailPage", "详细", 400, 500,true,"detailPageIfm");
	}

	function deleteCheck(){
		if(ownersWisitId == ""){
			Alert("请选择一条记录！");
			return ;
		}
		AskConfirm("确定要删除这条记录吗?","main","deleteData");
	}

	function deleteData(){
		var params ="";
		var url =ACTION_URL+"method=delete&keyword="+ownersWisitId;

		new Ajax.Request(url,
			         { method:'post',
					   asynchronous:false,
					   onComplete:refleshFrame
					 });
	}

	//查询
	function search(){
		var url = ACTION_URL+"method=setSearchCondition";
		var params = $("searchForm").serialize();
		cur_p = 1;
		sendAjaxRequest(url,params,refleshFrame);
	}

	//刷新
	function refleshFrame(){
		window.frames("ownersVisitListIfm").location.href = ACTION_URL+"method=queryOwnerVisitList&ec_p="+cur_p;
	}


</script>

<body>

<div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr>
		<td id="pageNav_leftimg"><img src="${ctx}/images/ico_custome_sq.gif" width="46" height="47" /></td>
		<td id="navWord"><span class="page_title">客户走访</span></td>
		<td class="pageNav_right">
			<a href="javascript:showFull_in();"><img id="full_image" src="${ctx}/images/ico_fullscreen.gif" border="0" /></a>
		</td>
	</tr>
</table>
</div>

<div class="container">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
	<tr>
		<td>
		<form id="searchForm" name="searchForm" method="post" action="" target="ownersVisitListIfm">
		<table width="100%" border="0" cellpadding="0" cellspacing="0" id="search01" class="bg_search">
			<tr>
				<td>
				<table border="0" cellpadding="0" cellspacing="1">
					<tr>
						<td class="grid align_left">房 号：</td>
						<td class="td_search align_left">
							<input name="houseNumber" type="text" class="inputtext" size="16" onkeydown="javascript:if (event.keyCode==13) submitSearch();" />
						</td>

						<td class="grid align_left">业 户：</td>
						<td class="td_search align_left">
							<input name="owners" type="text" class="inputtext" size="16" onkeydown="javascript:if (event.keyCode==13) submitSearch();" />
						</td>

						<td class="grid align_left">方 式：</td>
						<td class="td_search align_left">
							<input name="mode" type="text" class="inputtext" size="16" onkeydown="javascript:if (event.keyCode==13) submitSearch();" />
						</td>

						<td class="td_search">
						<table border="0" cellpadding="0" cellspacing="0">
							<tr>
								<td class="buttonOffLeft" id="btn1_111"></td>
								<td class="buttonOffMiddle" id="btn1_112" onclick="search();" onblur="btn_change(11)" onMouseOver="btn_change_over(11)" onMouseOut="btn_change_out(11)">
								<img src="${ctx}/images/ico_searchico.gif" alt="" border="0" align="absmiddle" /> 查 询</td>
								<td class="buttonOffRight" id="btn1_113"></td>
							</tr>
						</table>
						</td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</form>

		<table width="100%" border="0" cellpadding="0" cellspacing="0"  >
            <tr>
              <td class="bg_toolBar">
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td width="35%" align="right">
                    <table border="0" cellpadding="0" cellspacing="0" id="ico1">
                      <tr>
                      <pms:AuthTag authName="customerService_ownersVisitAction.do?method=addPage">
						<td class="toolbarico"><a href="#" onClick="openAdd();" onFocus="this.blur()"><img src="${ctx}/images/ico_newfile.gif" alt="新 增" width="16" height="16"  border="0" align="absbottom" /></a></td>
						</pms:AuthTag>
						<pms:AuthTag authName="customerService_ownersVisitAction.do?method=editPage">
						<td class="toolbarico"><a href="#" onclick="openEdit();" onFocus="this.blur()"><img src="${ctx}/images/ico_amend.gif" alt="修 改" width="16" height="16"  border="0" align="absbottom" /></a></td>
						</pms:AuthTag>
						<pms:AuthTag authName="customerService_ownersVisitAction.do?method=delete">
						<td class="toolbarico"><a href="#" onClick="deleteCheck();" onFocus="this.blur()"><img src="${ctx}/images/ico_delete.gif" alt="删 除" width="16" height="16"  border="0" align="absbottom" /></a></td>
					    </pms:AuthTag>
					 </tr>
                    </table>
                    </td>
                  </tr>
              </table>
              </td>
            </tr>

           	<tr>
				<td valign="top">
					<iframe id="ownersVisitListIfm" name="ownersVisitListIfm" src="${ctx}/customerService_ownersVisitAction.do?method=initList" frameborder="0" scrolling="auto" width="100%"></iframe>
				</td>
			</tr>
        </table>
		</td>
	</tr>
</table>
</div>

</body>
</html>
